//
// Created by lenovo on 2024/1/20.
//

#ifndef CALCULATOR_CALCULATOR_H
#define CALCULATOR_CALCULATOR_H

#include "../const/const.h"
#include "../Calc/_Calc_.h"
#include "../Translator/export.h"
#include <set>
#include <map>
#include <vector>
#include <string>

class Calculator {
public :
    [[nodiscard]] double calc(const std::string& expression) const;
    void loadFuncLib(const std::string& FuncLibName);
    explicit Calculator(
            std::vector<std::set<std::string> >* prio = &Priority::OptPrio

    )
            :  priority(prio)
    {
        this->_identified_funcs = new std::map< std::string , Functions::iFunction*>;
    }
protected:
public :
    std::vector< std::set<std::string> >* priority {nullptr} ;//定义了运算符的优先级
    std::map< std::string , Functions::iFunction*>* _identified_funcs;//需要用到的函数
};


#endif //CALCULATOR_CALCULATOR_H
